

# 包装器
def base_exception_wrapper(func):
    def inner(sec_str):
        try:
            _obj = func(sec_str)
        except KeyError as key_error:
            print('{error_type} has happened in this py '.format(error_type=key_error))
        except IndexError as index_error:
            print('{error_type} has happened in this py  '.format(error_type=index_error))
        else:
            return _obj

    return inner